- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Includes
Certificate & Practice Material
Programs for practice
In the program below, we've introduced beginers to programming in C
Source Code: Program to swap 2 numbers
# This Program will swap 2 numbers using call by value method
void swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
printf("swaped value in func are: %d\t%d",a,b);
}
void main()
{
int a,b;
printf("Enter values of a and b:");
scanf("%d%d",&a,&b);
swap(a,b);
printf("swaped value in main are: %d\t%d",a,b);
}
Output
Enter values of a and b: 4 5
swaped value in func are: 5 4
swaped value in main are :4 5